package com.example.order.feign.fallback;

import com.example.common.core.domain.Result;
import com.example.order.feign.ProductFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ProductFeignFallback implements ProductFeignClient {
    
    @Override
    public Result<Boolean> decreaseStock(Long productId, Integer quantity) {
        log.error("商品服务调用失败，触发fallback，productId: {}, quantity: {}", productId, quantity);
        log.error("当前时间: {}", java.time.LocalDateTime.now());
        return Result.error("商品服务暂时不可用，请稍后重试");
    }
} 